package com.sto.stoapp.activity;

import android.content.Intent;
import android.os.Bundle;

import com.sto.stoapp.broadcast.HomeBroadAction;
import com.sto.stoapp.manager.AlarmClockManager;
import com.sto.stoapp.widget.StoHomeActivity;

public class StoVehicleManagerActivity extends StoHomeActivity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.sto_vehicle_manager);
		this.register(HomeBroadAction.VEHICLE_MANAGER_BROAD);
		this.setStoTitle(R.string.vehicle_operation);
	}

	@Override
	protected void onNewIntent(Intent intent) {
		super.onNewIntent(intent);
		// 退出
		if (intent.getStringExtra(AlarmClockManager.ALARM_CLOCK_TYPE) != null) {
			if ((Intent.FLAG_ACTIVITY_CLEAR_TOP & intent.getFlags()) != 0
					&& intent
							.getStringExtra(AlarmClockManager.ALARM_CLOCK_TYPE)
							.equals(HomeBroadAction.ALARM_LOGOUT)) {
				// StoFilePreference.getInstance(this).clearLoginInfo();
				Intent logoutIntent = new Intent(this, StoLoginActivity.class);
				startActivity(logoutIntent);
				finish();
			}
		}
	}
}
